<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 300px;
            height: 300px;
            background: springgreen;
            position: absolute;
            right: 0;
            bottom: 0;
            /* position: relative; */
        }

        img {
            width: 50px;
            height: 50px;
            position: absolute;
            top: 0;
            right: 0;
        }
    </style>
</head>

<body>
    <div class="box">
        <img src="shanchu2.png" alt="" class="ig1">
    </div>
    <script>
        // 3 实现流氓广告的关闭, 显示一个流氓广告框，点击关闭后 4秒钟后继续显示出来 

        var box = document.getElementsByClassName("box")[0];
        var ig1 = document.getElementsByClassName("ig1")[0];
        ig1.onclick = function () {

            box.style.display = "none";
            setTimeout(function () {
                box.style.display = "block"
            }, 1000)

        };





    </script>


</body>

</html>